#include "FileSelect.h"


char  *pData[1] ={
    "Data File *.dat"
    };

char  *pDataExt[1] ={
    "*.dat"
    };

char  *pLog[1] ={
    "Log File *.log"
    };

char  *pLogExt[1] ={
    "*.log"
    };

char  *pRaw[1] ={
    "Raw Data File *.txt"
    };

char  *pRawExt[1] ={
    "*.txt"
    };

char  *pNetwork[1] ={
    "Neural Network File *.net"
    };

char  *pNetworkExt[1] ={
    "*.net"
    };

char **pFtypes[]={pData,pLog,pRaw,pNetwork};
char **pFExts[]={pDataExt,pLogExt,pRawExt,pNetworkExt};
bool in=false;
char* FileSelect(char *Msg,FileType f,SelectType s)
{
   char *fn;
   if(in) return NULL;
   in=true;
   if(s== Open)
       fn=fl_ext_file_chooser( Msg,pFtypes[f],pFExts[f],1, EXT_VALID_ONLY, FIL_READWRITE, NULL );
   else
       fn=fl_ext_file_chooser( Msg,pFtypes[f],pFExts[f],1, EXT_VALID_ONLY, FIL_WRITE, NULL );
   in =false;
   return fn;
}

